home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
usenet
/
sources
/
volume90
/
aplictns
/
route_10
/
part01
next >
Wrap
Internet Message Format
|
1990-04-23
|
66KB
Path: xanth!cs.odu.edu!Amiga-Request
From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
Newsgroups: comp.sources.amiga
Subject: v90i151: route 1.0 - printed circuit board router, Part01/06
Message-ID: <12281@xanth.cs.odu.edu>
Date: 23 Apr 90 00:08:39 GMT
Sender: tadguy@cs.odu.edu
Reply-To: finkel%TAURUS.BITNET@CUNYVM.CUNY.EDU
Lines: 2343
Approved: tadguy@cs.odu.edu (Tad Guy)
X-Mail-Submissions-To: Amiga@cs.odu.edu
X-Post-Discussions-To: comp.sys.amiga
Submitted-by: finkel%TAURUS.BITNET@CUNYVM.CUNY.EDU
Posting-number: Volume 90, Issue 151
Archive-name: applications/route-1.0/part01
Enclosed is a C based PCB autorouter I found on a BBS ( Ciarcia's
circuit cellar BBS ). It seems the file was picked up from Usenet. I
tried mailing the author but got no reply.
Anyhow, the program was for an AT with an EGA monitor. I ported the
autorouter and the previewer, but not the PCB printer, since it was
intended for an HP LaserJet II printer, which I don't have. ...
The original previewer stored the different PCB patterns ( which includes
holes, horizontal,vertical and diagonal lines, line corners, etc. ) in
an integer matrix , with 1 for 'on' and 0 for 'off'. There are about
30 different patterns in 4 different sizes. The program used a routine
similar to WritePixel to draw the PCB on the screen. not only was this slow
( about 10 seconds on a 12MHz AT for a full size board, with the program
compiled for 286 instruction set, and 15 seconds for a direct port of
the same program on the Amiga using WritePixel() ), but these arrays made
the program much bigger than it should have been. I converted the previewer
to use packed bitmap arrays ( like Image structures ), and use the
BltPattern() routine to draw each PCB pattern, and now the screen update
time has gone down to 2 seconds for a full board!
I kept all the old files in a seperate directory called 'old'. The
original bitmap files are needed for the printer program which I still
didn't port.
[ the ``old'' directory is included in the sources posting only ...tad]
Udi
#!/bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 6)."
# Contents: Makefile Readme.AMIGA alloc.c astar bfs bitblt.c bitblt1.h
# cell.h dist.c examples examples/ex1 examples/ex2 examples/example
# inc inc/ttl.inc inc/ttl7400.inc inc/ttl7401.inc inc/ttl7402.inc
# inc/ttl7403.inc inc/ttl7404.inc inc/ttl7405.inc inc/ttl7406.inc
# inc/ttl7407.inc inc/ttl7408.inc inc/ttl7409.inc inc/ttl7410.inc
# inc/ttl7411.inc inc/ttl7412.inc inc/ttl7413.inc inc/ttl7414.inc
# inc/ttl7415.inc inc/ttl7419.inc inc/ttl7420.inc inc/ttl7421.inc
# inc/ttl7422.inc inc/ttl7423.inc inc/ttl7424.inc inc/ttl7425.inc
# inc/ttl7426.inc inc/ttl7427.inc inc/ttl7428.inc inc/ttl7430.inc
# inc/ttl7431.inc inc/ttl7486.inc old old/bitmap.c old/bitmap1.h
# queue.c sources.hdr util.c work.c
# Wrapped by tadguy@xanth on Sun Apr 22 20:07:54 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1551 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# printed circuit board autorouter, viewer, and printer
X#
X# Makefile.xen for Xenix 286 by Harold Hankins
X#
X
X#
X# .c.obj:
X# cl /G2s /Oat /W3 /Zp /c $*.c
X#
X# .asm.obj:
X# masm /t /ml $*.asm;
X#
XCFLAGS= -n
XLIBS= -lm -lc
XLFLAGS = -g
X
XROBJS= pcbroute.o io.o solve.o board.o queue.o work.o dist.o alloc.o
XVOBJS= pcbview.o bitmap.o board.o alloc.o util.o
XVBOBJS= pcbltv.o bitblt.o board.o alloc.o util.o
XPOBJS= pcbprint.o bitmap.o board.o alloc.o
X
X
Xallprg: pcbroute pcbprint pcbview
X
Xpcbroute: $(ROBJS)
X ln $(LFLAGS) -o pcbroute $(ROBJS) $(LIBS)
X
Xpcbview: $(VOBJS)
X ln $(LFLAGS) -o pcbview $(VOBJS) $(LIBS)
X
Xpcbltv: $(VBOBJS)
X ln $(LFLAGS) +Cd -o pcbltv $(VBOBJS) $(LIBS)
X
Xpcbprint: $(POBJS)
X ln $(LFLAGS) -o pcbprint $(POBJS) $(LIBS)
X
Xprintr:
X @prl pcbroute.c io.c solve.c board.c queue.c work.c dist.c alloc.c cell.h
X
Xtestr:
X cd ../inc ; pcbroute example hwh.out ; sum hwh.*
X
Xtestp:
X cd ../inc ; pcbprint hwh.out
X
Xpcbroute.o: pcbroute.c cell.h
X
Xio.o: io.c cell.h
X
Xsolve.o: solve.c cell.h
X
Xboard.o: board.c cell.h
X
Xqueue.o: queue.c cell.h
X
Xwork.o: work.c cell.h
X
Xdist.o: dist.c cell.h
X
Xalloc.o: alloc.c
X
Xpcbview.o: pcbview.c pcbview.h cell.h
X cc $(CFLAGS) +IAztec:include.pre pcbview.c
X
Xpcbltv.o: pcbltv.c pcbview.h cell.h
X cc $(CFLAGS) +IAztec:include.pre pcbltv.c
X
Xbitmap.o: bitmap.c cell.h bitmap1.h bitmap2.h bitmap3.h
X
Xbitblt.o: bitblt.c cell.h bitblt1.h bitblt2.h bitblt3.h
X cc $(CFLAGS) +IAztec:include.pre bitblt.c
X
Xutil.o: util.c
X cc $(CFLAGS) +IAztec:include.pre util.c
X
Xpcbprint.o: pcbprint.c cell.h
X
Xclean:
X @rm -f $(ROBJS) $(VOBJS) $(POBJS)
END_OF_FILE
if test 1551 -ne `wc -c <'Makefile'`; then
echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'Readme.AMIGA' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'Readme.AMIGA'\"
else
echo shar: Extracting \"'Readme.AMIGA'\" \(3212 characters\)
sed "s/^X//" >'Readme.AMIGA' <<'END_OF_FILE'
XAbout this package
X------------------
X
XThis is a modified version of the PCB autorouting package written by
XRandy Nevin. It has been ported to the Amiga and enhanced in a few
Xways:
X
X1. The PCBView program has been intuition-ized. There are 2 versions of
X the previewer. One is called 'PCBView', just like the original, and
X the other one is called 'PCBltV', which standa for 'PCBlitterView'.
X The new previewer uses a new set of bitmap images or the board, which
X are stored in a more condensed form than the old program, even though
X it's less portable now. The old previewer used WritePixel() to draw
X the whole screen! The new previewer uses the Blitter ( BltPattern() ),
X and is about 8 times faster. The demo PCB, which took 15 seconds to
X draw at maximum size using the old previewer, now takes 2 seconds with
X the new previer. All the files related to the old viewer are in the
X 'old' subdirectory in this archive file. Notice that PCBPrint.c is
X also there, since I didn't port it yet.
X
X2. The autorouter now supports routing of single sided boards. just add
X the '-s' switch when running PCBRoute. This is good for simple circuits,
X since double sided boards are much more difficult to manufacture for
X hobbyists, and not always there is a need for one.
X
X
XFuture plans:
X-------------
X
X1. Write a version of PCBPrint that will use the preference printer.
X Don't hold your breath for this, since I don't have a printer at
X home.
X
X2. Write a version of PCBPrint for PostScript printers. This is much
X easier for me to do, since I have access to a PostScript printer,
X and having a copy of GhostScript(*) for the Amiga surely helps...
X
X [ GhostScript may or may not be a trademark of the Free Software
X Foundation ;-) ].
X
X3. Improving the autorouter. Currently, the autorouter will not try
X to retrace a trace if it disturbs another trace ( very important
X for single sided boards ), but I may TRY to change this in a
X future revision. Another optimization which comes to mind is
X that if A is connected to B, and B is connected to C, the router
X may choose to connect any 2 of the 3 possible connections ( A<>B,
X B<>C, and A<>C ), whichever gives the best result.
X
XNew files:
X----------
X
Xpcbltv.c - the modified source code for the new previewer.
Xbitblt*.* - modified versions of bitmap*.* . Images are stored
X as bitmaps instead of a 2d array with 0's and 1's in it.
X The images in bitmap*.h are stored upside down. The images in
X bitblt*.h are stored normally.
X
XDisclaimer:
X-----------
XSee the original disclaimer in the file 'ReadMe'. it applies to my
Xchanges as well.
X
XIf you have any suggestions, improvements, questions, etc., you can send
Xthem to:
X
XUdi Finkelstein
X10 Glitzenstein st.
X64686 Tel Aviv
XIsrael
X
Xor, if you have EMail access:
X
Xfinkel@taurus.BITNET
X
XIf you have any questions about the previewer, you can ask me. If
Xyou have any questions about the router itself, you will be better
Xoff asking Randy Nevin himself, who surely knows better about it's
Xinternal structure than me... Randy Nevin's address is ( copied
Xfrom the 'Readme' file he wrote ):
X
X
XRandy Nevin, 1731 211th pl ne, redmond, wa 98053
END_OF_FILE
if test 3212 -ne `wc -c <'Readme.AMIGA'`; then
echo shar: \"'Readme.AMIGA'\" unpacked with wrong size!
fi
# end of 'Readme.AMIGA'
fi
if test -f 'alloc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'alloc.c'\"
else
echo shar: Extracting \"'alloc.c'\" \(1106 characters\)
sed "s/^X//" >'alloc.c' <<'END_OF_FILE'
X#include <stdio.h>
X
Xextern char *malloc();
X
Xvoid Nomem();
X
X/*
X * allocate x bytes of far memory
X */
Xchar *Alloc(x)
Xlong x;
X{
X char *fp;
X
X if (x >= 0x10000) {
X printf("Error! malloc() too big!\n");
X exit(-1);
X }
X if ((fp = malloc((short) x)) == NULL)
X Nomem(); /* memory allocation error */
X return(fp);
X}
X
X/*
X * a memory allocation request has failed
X */
Xvoid Nomem ()
X{
X printf( "out of memory\n" );
X exit( -1 );
X}
X
X/*
X * Free memory alloctated by Alloc();
X */
XFree(x)
Xchar *x;
X{
X free(x);
X}
X
X/* edlib version 1.0 of 04/08/88 */
X/*
X string to upper changes all lower case letters in a string to upper
X case.
X*/
X#include <ctype.h>
X
Xchar *strupr(str)
Xchar *str;
X{
X char *temp = str;
X
X for ( ; *temp ; temp++ )
X *temp = (char) toupper(*temp);
X
X return(str);
X}
X
Xint stricmp(str1,str2)
Xchar *str1,*str2;
X{
X int index = 0;
X
X while ( str1[index] && str2[index] &&
X tolower(str1[index]) == tolower(str2[index]) )
X ++index;
X
X return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
X ( (tolower(str1[index]) > tolower(str2[index])) ? 1 : 0) );
X}
END_OF_FILE
if test 1106 -ne `wc -c <'alloc.c'`; then
echo shar: \"'alloc.c'\" unpacked with wrong size!
fi
# end of 'alloc.c'
fi
if test -f 'astar' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'astar'\"
else
echo shar: Extracting \"'astar'\" \(2952 characters\)
sed "s/^X//" >'astar' <<'END_OF_FILE'
XA* Algorithm (* heuristic search *)
X (* Search a graph or state space, depending on the problem definition. *)
X (* S is the start node, T is the goal node. *)
X (* Open is an ordered list of nodes (ordered by lowest F value; see below),
X also called a priority queue. Closed is a set of nodes (order doesn't
X matter). In general, nodes that need to be searched are put on Open (at
X the proper position). As they are searched, they are removed from Open
X and put in Closed. Occasionally a newer, better route will be found to a
X node after it has already been searched, in which case we remove it from
X Closed and put it back on Open to be reconsidered. *)
X (* G[x] is the distance already traveled to get from S to node x, and is
X known exactly. H(x) is a function (heuristic) which returns an estimate
X of the distance from node x to T. F[x] is the estimated distance from S
X to T by going through node x, and is computed by F[x] = G[x] + H(x).
X H(x) can be calculated for any node, but F[x] and G[x] only become
X defined when node x is visited. *)
X (* Pred is defined for each node, and is a list of "came from" indications,
X so when we finally reach T, we traverse Pred to construct a path to
X S. *)
X (* Distance(x,y) is a function for calculating the distance between two
X neighboring nodes. *)
X1 Open <- {S} (* a list of one element *)
X Closed <- {} (* the empty set *)
X G[S] <- 0, F[S] <- 0, Pred[S] <- NULL, found <- FALSE
X WHILE Open <> {} and not found DO
X5 x <- the first node on Open (* node with smallest F value *)
X Open <- Open - {x} (* remove x from Open *)
X Closed <- Closed + {x} (* put x in Closed *)
X IF x = T THEN found <- TRUE (* we're done *)
X ELSE (* continue search through node x *)
X10 let R be the set of neighboring nodes of x
X FOR each y in R DO
X IF y is not on Open or in Closed THEN
X G[y] <- G[x] + Distance(x,y)
X F[y] <- G[y] + H(y) (* estimate solution path length *)
X15 Pred[y] <- x (* remember where we came from *)
X Open <- Open + {y} (* put y on Open *)
X ELSE (* y is on Open or in Closed *)
X IF (G[x] + Distance(x,y)) < G[y] THEN
X (* we've found a better route to y *)
X20 G[y] <- G[x] + Distance(x,y)
X F[y] <- G[y] + H(y)
X Pred[y] <- x (* remember where we came from *)
X IF y is on Open THEN
X reposition y according to F[y]
X25 ELSE (* y is in Closed *)
X Closed <- Closed - {y} (* remove y from Closed *)
X Open <- Open + {y} (* put y on Open *)
X IF found THEN
X use Pred[T] to find Pred[Pred[T]] and so on until S is reached
X30 (* this traces out the solution path in reverse *)
X ELSE T cannot be reached from S
END_OF_FILE
if test 2952 -ne `wc -c <'astar'`; then
echo shar: \"'astar'\" unpacked with wrong size!
fi
# end of 'astar'
fi
if test -f 'bfs' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bfs'\"
else
echo shar: Extracting \"'bfs'\" \(1498 characters\)
sed "s/^X//" >'bfs' <<'END_OF_FILE'
XBFS Algorithm (* breadth-first search *)
X (* Search a graph or state space, depending on the problem definition. *)
X (* S is the start node, T is the goal node. *)
X (* Open is an ordered list of nodes (ordered by arrival time; nodes enter
X at the tail and leave at the head), also called a queue. Closed is a set
X of nodes (order doesn't matter). In general, nodes that need to be
X searched are put on Open. As they are searched, they are removed from
X Open and put in Closed. *)
X (* Pred is defined for each node, and is a list of "came from" indications,
X so when we finally reach T, we traverse Pred to construct a path to S. *)
X1 Open <- {S} (* a list of one element *)
X Closed <- {} (* the empty set *)
X Pred[S] <- NULL, found <- FALSE
X WHILE Open <> {} and not found DO
X5 x <- the first node on Open
X Open <- Open - {x} (* remove x from Open *)
X Closed <- Closed + {x} (* put x in Closed *)
X IF x = T THEN found <- TRUE (* we're done *)
X ELSE (* continue search through node x *)
X10 let R be the set of neighboring nodes of x
X FOR each y in R DO
X IF y is not on Open or in Closed THEN
X Pred[y] <- x (* remember where we came from *)
X Open <- Open + {y} (* put y on Open (at the tail) *)
X15 IF found THEN
X use Pred[T] to find Pred[Pred[T]] and so on until S is reached
X (* this traces out the solution path in reverse *)
X ELSE T cannot be reached from S
END_OF_FILE
if test 1498 -ne `wc -c <'bfs'`; then
echo shar: \"'bfs'\" unpacked with wrong size!
fi
# end of 'bfs'
fi
if test -f 'bitblt.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitblt.c'\"
else
echo shar: Extracting \"'bitblt.c'\" \(1324 characters\)
sed "s/^X//" >'bitblt.c' <<'END_OF_FILE'
X#include "cell.h"
X
X#define ZOOM0 3 /* 3x3 pixels per cell */
X#define ZOOM1 6 /* 6x6 pixels per cell */
X#define ZOOM2 10 /* 10x10 pixels per cell */
X#define ZOOM3 18 /* 18x18 pixels per cell */
X
X/*
X** the templates assume the pixels on your screen have a 1:1 aspect ratio. for
X** almost all screens, this is not true. therefore, the screen view will be
X** slightly distorted (things will look like they are stretched top to bottom,
X** or squashed side to side). if you really want things to look like reality,
X** you could change the dimensions of the templates. for example, if your
X** screen has a 2:1 aspect ratio (most are more like 1.4:1), use a [3][6]
X** template instead of a [3][3] one. as long as you keep this in mind while
X** viewing the results, it's probably not worth the effort.
X*/
X
Xstruct templates { /* group the bit templates for an object */
X long t; /* the object type */
X struct Image im[4]; /* tiny, small, medium, large zoom templates */
X};
X
X/* these got too big to keep in one file, so i moved them to include files */
X
X#include "bitblt1.h"
X
X#include "bitblt2.h"
X
X#include "bitblt3.h"
X
Xint z1 = sizeof(y1)/sizeof(y1[0]); /* number of hole types */
Xint z2 = sizeof(y2)/sizeof(y2[0]); /* number of hole-related types */
Xint z3 = sizeof(y3)/sizeof(y3[0]); /* number of non-hole-related types */
END_OF_FILE
if test 1324 -ne `wc -c <'bitblt.c'`; then
echo shar: \"'bitblt.c'\" unpacked with wrong size!
fi
# end of 'bitblt.c'
fi
if test -f 'bitblt1.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bitblt1.h'\"
else
echo shar: Extracting \"'bitblt1.h'\" \(937 characters\)
sed "s/^X//" >'bitblt1.h' <<'END_OF_FILE'
X/* hole templates */
X/* NOTE: these templates are UPSIDE-DOWN from what you see on the screen!!! */
X
X/*
X * hole templates
X */
X
XUSHORT Hole0[] = {
X 0x0000,
X 0x4000,
X 0x0000
X};
X
XUSHORT Hole1[] = {
X 0x0000,
X 0x3000,
X 0x4800,
X 0x4800,
X 0x3000,
X 0x0000
X};
X
XUSHORT Hole2[] = {
X 0x0000,
X 0x0000,
X 0x0c00,
X 0x1200,
X 0x2100,
X 0x2100,
X 0x1200,
X 0x0c00,
X 0x0000,
X 0x0000
X};
X
XUSHORT Hole3[] = {
X 0x0000, 0x0000,
X 0x0000, 0x0000,
X 0x0000, 0x0000,
X 0x0000, 0x0000,
X 0x03f0, 0x0000,
X 0x0408, 0x0000,
X 0x0804, 0x0000,
X 0x0804, 0x0000,
X 0x0804, 0x0000,
X 0x0804, 0x0000,
X 0x0804, 0x0000,
X 0x0804, 0x0000,
X 0x0408, 0x0000,
X 0x03f0, 0x0000,
X 0x0000, 0x0000,
X 0x0000, 0x0000,
X 0x0000, 0x0000,
X 0x0000, 0x0000
X};
X
Xstruct templates y1[] = {
X {
X HOLE, {
X { 0, 0, ZOOM0, ZOOM0, 1, Hole0, 7, 0, NULL },
X { 0, 0, ZOOM1, ZOOM1, 1, Hole1, 7, 0, NULL },
X { 0, 0, ZOOM2, ZOOM2, 1, Hole2, 7, 0, NULL },
X { 0, 0, ZOOM3, ZOOM3, 1, Hole3, 7, 0, NULL },
X }
X }
X};
END_OF_FILE
if test 937 -ne `wc -c <'bitblt1.h'`; then
echo shar: \"'bitblt1.h'\" unpacked with wrong size!
fi
# end of 'bitblt1.h'
fi
if test -f 'cell.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'cell.h'\"
else
echo shar: Extracting \"'cell.h'\" \(2939 characters\)
sed "s/^X//" >'cell.h' <<'END_OF_FILE'
X/* the low-order bit indicates a hole */
X#define HOLE 0x00000001L /* a conducting hole */
X
X/* traces radiating outward from a hole to a side or corner */
X#define HOLE_NORTH 0x00000002L /* upward */
X#define HOLE_NORTHEAST 0x00000004L /* upward and right */
X#define HOLE_EAST 0x00000008L /* to the right */
X#define HOLE_SOUTHEAST 0x00000010L /* downward and right */
X#define HOLE_SOUTH 0x00000020L /* downward */
X#define HOLE_SOUTHWEST 0x00000040L /* downward and left */
X#define HOLE_WEST 0x00000080L /* to the left */
X#define HOLE_NORTHWEST 0x00000100L /* upward and left */
X
X/* straight lines through the center */
X#define LINE_HORIZONTAL 0x00000002L /* left-to-right line */
X#define LINE_VERTICAL 0x00000004L /* top-to-bottom line */
X
X/* lines cutting across a corner, connecting adjacent sides */
X#define CORNER_NORTHEAST 0x00000008L /* upper right corner */
X#define CORNER_SOUTHEAST 0x00000010L /* lower right corner */
X#define CORNER_SOUTHWEST 0x00000020L /* lower left corner */
X#define CORNER_NORTHWEST 0x00000040L /* upper left corner */
X
X/* diagonal lines through the center */
X#define DIAG_NEtoSW 0x00000080L /* northeast to southwest */
X#define DIAG_SEtoNW 0x00000100L /* southeast to northwest */
X
X/* 135 degree angle side-to-far-corner lines */
X#define BENT_NtoSE 0x00000200L /* north to southeast */
X#define BENT_NtoSW 0x00000400L /* north to southwest */
X#define BENT_EtoSW 0x00000800L /* east to southwest */
X#define BENT_EtoNW 0x00001000L /* east to northwest */
X#define BENT_StoNW 0x00002000L /* south to northwest */
X#define BENT_StoNE 0x00004000L /* south to northeast */
X#define BENT_WtoNE 0x00008000L /* west to northeast */
X#define BENT_WtoSE 0x00010000L /* west to southeast */
X
X/* 90 degree corner-to-adjacent-corner lines */
X#define ANGLE_NEtoSE 0x00020000L /* northeast to southeast */
X#define ANGLE_SEtoSW 0x00040000L /* southeast to southwest */
X#define ANGLE_SWtoNW 0x00080000L /* southwest to northwest */
X#define ANGLE_NWtoNE 0x00100000L /* northwest to northeast */
X
X/* 45 degree angle side-to-near-corner lines */
X#define SHARP_NtoNE 0x00200000L /* north to northeast */
X#define SHARP_EtoNE 0x00400000L /* east to northeast */
X#define SHARP_EtoSE 0x00800000L /* east to southeast */
X#define SHARP_StoSE 0x01000000L /* south to southeast */
X#define SHARP_StoSW 0x02000000L /* south to southwest */
X#define SHARP_WtoSW 0x04000000L /* west to southwest */
X#define SHARP_WtoNW 0x08000000L /* west to northwest */
X#define SHARP_NtoNW 0x10000000L /* north to northwest */
X
X/* directions the cell can be reached from (point to previous cell) */
X#define FROM_NORTH 1
X#define FROM_NORTHEAST 2
X#define FROM_EAST 3
X#define FROM_SOUTHEAST 4
X#define FROM_SOUTH 5
X#define FROM_SOUTHWEST 6
X#define FROM_WEST 7
X#define FROM_NORTHWEST 8
X#define FROM_OTHERSIDE 9
X
X#define TOP 0
X#define BOTTOM 1
X#define EMPTY 0
X#define ILLEGAL -1
X
X#ifdef M_XENIX
Xchar far *_fmalloc();
X#endif
X
END_OF_FILE
if test 2939 -ne `wc -c <'cell.h'`; then
echo shar: \"'cell.h'\" unpacked with wrong size!
fi
# end of 'cell.h'
fi
if test -f 'dist.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'dist.c'\"
else
echo shar: Extracting \"'dist.c'\" \(3896 characters\)
sed "s/^X//" >'dist.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include "cell.h"
X
Xint GetApxDist ( r1, c1, r2, c2 ) /* calculate approximate distance */
X int r1, c1, r2, c2;
X {
X register int d1, d2; /* row and column deltas */
X int d0; /* temporary variable for swapping d1 and d2 */
X
X /* NOTE: the -25 used below is because we are not going from the */
X /* center of (r1,c1) to the center of (r2,c2), we are going from */
X /* the edge of a hole at (r1,c1) to the edge of a hole at (r2,c2). */
X /* holes are 25 mils in diameter (12.5 mils in radius), so we back */
X /* off by 2 radii. */
X if ((d1 = r1-r2) < 0) /* get absolute row delta */
X d1 = -d1;
X if ((d2 = c1-c2) < 0) /* get absolute column delta */
X d2 = -d2;
X if (!d1) /* in same row? */
X return( (d2*50)-25 ); /* 50 mils per cell */
X if (!d2) /* in same column? */
X return( (d1*50)-25 ); /* 50 mils per cell */
X if (d1 > d2) { /* get smaller into d1 */
X d0 = d1;
X d1 = d2;
X d2 = d0;
X }
X d2 -= d1; /* get non-diagonal part of approximate "route" */
X return( (d1*71)+(d2*50)-25 ); /* 71 mils diagonally per cell */
X }
X
X/* distance to go thru a cell */
Xstatic int dist[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
X /* N, NE, E, SE, S, SW, W, NW, OT, OR */
X/* N */ { 50, 60, 35, 60, 99, 60, 35, 60, 12, 12 },
X/* NE */ { 60, 71, 60, 71, 60, 99, 60, 71, 23, 23 },
X/* E */ { 35, 60, 50, 60, 35, 60, 99, 60, 12, 12 },
X/* SE */ { 60, 71, 60, 71, 60, 71, 60, 99, 23, 23 },
X/* S */ { 99, 60, 35, 60, 50, 60, 35, 60, 12, 12 },
X/* SW */ { 60, 99, 60, 71, 60, 71, 60, 71, 23, 23 },
X/* W */ { 35, 60, 99, 60, 35, 60, 50, 60, 12, 12 },
X/* NW */ { 60, 71, 60, 99, 60, 71, 60, 71, 23, 23 },
X
X/* OT */ { 12, 23, 12, 23, 12, 23, 12, 23, 99, 99 },
X/* OR */ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 }
X };
X
X/* distance around (circular) segment of hole */
Xstatic int circ[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
X /* N, NE, E, SE, S, SW, W, NW, OT, OR */
X/* N */ { 39, 29, 20, 10, 0, 10, 20, 29, 99, 0 },
X/* NE */ { 29, 39, 29, 20, 10, 0, 10, 20, 99, 0 },
X/* E */ { 20, 29, 39, 29, 20, 10, 0, 10, 99, 0 },
X/* SE */ { 10, 20, 29, 39, 29, 20, 10, 0, 99, 0 },
X/* S */ { 0, 10, 20, 29, 39, 29, 20, 10, 99, 0 },
X/* SW */ { 10, 0, 10, 20, 29, 39, 29, 20, 99, 0 },
X/* W */ { 20, 10, 0, 10, 20, 29, 39, 29, 99, 0 },
X/* NW */ { 29, 20, 10, 0, 10, 20, 29, 39, 99, 0 },
X
X/* OT */ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 0 },
X/* OR */ { 99, 99, 99, 99, 99, 99, 99, 99, 99, 0 }
X };
X
X/* penalty for extraneous holes and corners, scaled by sharpness of turn */
Xstatic int penalty[10][10] = { /* OT=Otherside, OR=Origin (source) cell */
X /* N, NE, E, SE, S, SW, W, NW, OT, OR */
X/* N */ { 0, 5, 10, 15, 20, 15, 10, 5, 50, 0 },
X/* NE */ { 5, 0, 5, 10, 15, 20, 15, 10, 50, 0 },
X/* E */ { 10, 5, 0, 5, 10, 15, 20, 15, 50, 0 },
X/* SE */ { 15, 10, 5, 0, 5, 10, 15, 20, 50, 0 },
X/* S */ { 20, 15, 10, 5, 0, 5, 10, 15, 50, 0 },
X/* SW */ { 15, 20, 15, 10, 5, 0, 5, 10, 50, 0 },
X/* W */ { 10, 15, 20, 15, 10, 5, 0, 5, 50, 0 },
X/* NW */ { 5, 10, 15, 20, 15, 10, 5, 0, 50, 0 },
X
X/* OT */ { 50, 50, 50, 50, 50, 50, 50, 50, 100, 0 },
X/* OR */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
X };
X
X/*
X** x is the direction to enter the cell of interest.
X** y is the direction to exit the cell of interest.
X** z is the direction to really exit the cell, if y=FROM_OTHERSIDE.
X**
X** return the distance of the trace through the cell of interest.
X** the calculation is driven by the tables above.
X*/
X
Xint CalcDist ( x, y, z ) /* calculate distance of a trace through a cell */
X int x, y, z;
X {
X int adjust;
X
X adjust = 0; /* set if hole is encountered */
X if (x == EMPTY)
X x = 10;
X if (y == EMPTY)
X y = 10;
X else if (y == FROM_OTHERSIDE) {
X if (z == EMPTY)
X z = 10;
X adjust = circ[x-1][z-1] + penalty[x-1][z-1];
X }
X return( dist[x-1][y-1] + penalty[x-1][y-1] + adjust );
X }
END_OF_FILE
if test 3896 -ne `wc -c <'dist.c'`; then
echo shar: \"'dist.c'\" unpacked with wrong size!
fi
# end of 'dist.c'
fi
if test ! -d 'examples' ; then
echo shar: Creating directory \"'examples'\"
mkdir 'examples'
fi
if test -f 'examples/ex1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'examples/ex1'\"
else
echo shar: Extracting \"'examples/ex1'\" \(821 characters\)
sed "s/^X//" >'examples/ex1' <<'END_OF_FILE'
X; This example shows how PRIORITY can be used to correctly route a one
X; sided board which was otherwise un-route-able.
X; ex1 - the example file without 'priority' keyword
X; ex2 - the example file after adding 'priority' keyword to 2 of the lines.
X
Xdimension (15,30)
X
Xinclude pcbinc:ttl7400.inc
X
X; power and ground are supplied here
Xhole (3,20)
Xhole (3,25)
X
X; ~R - input
Xhole (15,5)
X; ~S - input
Xhole (15,7)
X
X; Q - output
Xhole (3,9)
X; ~Q - output
Xhole (3,11)
X
X; four instances of the above chip
Xchipat (6,5) name=nand0 type=ttl7400 orientation=normal
X
X; connect power and ground to all chips
Xconnect (3,20) and nand0.vcc
Xconnect (3,25) and nand0.gnd
Xconnect (15,5) and nand0.a1
Xconnect (15,7) and nand0.a2
Xconnect nand0.y1 and nand0.b2
Xconnect nand0.y2 and nand0.b1
Xconnect nand0.y1 and (3,9)
Xconnect nand0.y2 and (3,11)
END_OF_FILE
if test 821 -ne `wc -c <'examples/ex1'`; then
echo shar: \"'examples/ex1'\" unpacked with wrong size!
fi
# end of 'examples/ex1'
fi
if test -f 'examples/ex2' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'examples/ex2'\"
else
echo shar: Extracting \"'examples/ex2'\" \(839 characters\)
sed "s/^X//" >'examples/ex2' <<'END_OF_FILE'
X; This example shows how PRIORITY can be used to correctly route a one
X; sided board which was otherwise un-route-able.
X; ex1 - the example file without 'priority' keyword
X; ex2 - the example file after adding 'priority' keyword to 2 of the lines.
X
Xdimension (15,30)
X
Xinclude pcbinc:ttl7400.inc
X
X; power and ground are supplied here
Xhole (3,20)
Xhole (3,25)
X
X; ~R - input
Xhole (15,5)
X; ~S - input
Xhole (15,7)
X
X; Q - output
Xhole (3,9)
X; ~Q - output
Xhole (3,11)
X
X; four instances of the above chip
Xchipat (6,5) name=nand0 type=ttl7400 orientation=normal
X
X; connect power and ground to all chips
Xconnect (3,20) and nand0.vcc
Xconnect (3,25) and nand0.gnd
Xpriority connect (15,5) and nand0.a1
Xpriority connect (15,7) and nand0.a2
Xconnect nand0.y1 and nand0.b2
Xconnect nand0.y2 and nand0.b1
Xconnect nand0.y1 and (3,9)
Xconnect nand0.y2 and (3,11)
END_OF_FILE
if test 839 -ne `wc -c <'examples/ex2'`; then
echo shar: \"'examples/ex2'\" unpacked with wrong size!
fi
# end of 'examples/ex2'
fi
if test -f 'examples/example' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'examples/example'\"
else
echo shar: Extracting \"'examples/example'\" \(2104 characters\)
sed "s/^X//" >'examples/example' <<'END_OF_FILE'
X; a circuit for calculating a parity bit for a 16-bit word (an xor tree)
Xdimension (29,37)
X
X; include necessary part
Xinclude pcbinc:ttl7486.inc
X
X; power and ground are supplied here
Xhole (3,20)
Xhole (3,25)
X
X; the 16-bit input word
Xhole (26,5)
Xhole (26,7)
Xhole (26,9)
Xhole (26,11)
Xhole (26,13)
Xhole (26,15)
Xhole (26,17)
Xhole (26,19)
Xhole (26,21)
Xhole (26,23)
Xhole (26,25)
Xhole (26,27)
Xhole (26,29)
Xhole (26,31)
Xhole (26,33)
Xhole (26,35)
X
X; the output (parity) bit
Xhole (3,11)
X
X; four instances of the above chip
Xchipat (6,5) name=xor0 type=ttl7486 orientation=normal
Xchipat (6,21) name=xor1 type=ttl7486 orientation=normal
Xchipat (16,5) name=xor2 type=ttl7486 orientation=normal
Xchipat (16,21) name=xor3 type=ttl7486 orientation=normal
X
X; connect power and ground to all chips
Xpriority connect (3,20) and xor0.vcc
Xpriority connect (3,20) and xor1.vcc
Xpriority connect (3,20) and xor2.vcc
Xpriority connect (3,20) and xor3.vcc
Xpriority connect (3,25) and xor0.gnd
Xpriority connect (3,25) and xor1.gnd
Xpriority connect (3,25) and xor2.gnd
Xpriority connect (3,25) and xor3.gnd
X
X; condense 16 bits into 8 bits
Xconnect (26,5) and xor2.a1
Xconnect (26,7) and xor2.b1
Xconnect (26,9) and xor2.a2
Xconnect (26,11) and xor2.b2
Xconnect (26,13) and xor2.a3
Xconnect (26,15) and xor2.b3
Xconnect (26,17) and xor2.a4
Xconnect (26,19) and xor2.b4
Xconnect (26,21) and xor3.a1
Xconnect (26,23) and xor3.b1
Xconnect (26,25) and xor3.a2
Xconnect (26,27) and xor3.b2
Xconnect (26,29) and xor3.a3
Xconnect (26,31) and xor3.b3
Xconnect (26,33) and xor3.a4
Xconnect (26,35) and xor3.b4
X
X; condense 8 bits into 4 bits
Xconnect xor2.y1 and xor1.a1
Xconnect xor2.y2 and xor1.b1
Xconnect xor2.y3 and xor1.a2
Xconnect xor2.y4 and xor1.b2
Xconnect xor3.y1 and xor1.a3
Xconnect xor3.y2 and xor1.b3
Xconnect xor3.y3 and xor1.a4
Xconnect xor3.y4 and xor1.b4
X
X; condense 4 bits into 2 bits
Xconnect xor1.y1 and xor0.a1
Xconnect xor1.y2 and xor0.b1
Xconnect xor1.y3 and xor0.a2
Xconnect xor1.y4 and xor0.b2
X
X; condense 2 bits into 1 bit
Xconnect xor0.y1 and xor0.a3
Xconnect xor0.y2 and xor0.b3
X
X; connect the output (parity) bit
Xpriority connect xor0.y3 and (3,11)
END_OF_FILE
if test 2104 -ne `wc -c <'examples/example'`; then
echo shar: \"'examples/example'\" unpacked with wrong size!
fi
# end of 'examples/example'
fi
if test ! -d 'inc' ; then
echo shar: Creating directory \"'inc'\"
mkdir 'inc'
fi
if test -f 'inc/ttl.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl.inc'\"
else
echo shar: Extracting \"'inc/ttl.inc'\" \(2152 characters\)
sed "s/^X//" >'inc/ttl.inc' <<'END_OF_FILE'
X; include all ttl types
X;
X; 7400 = quadruple 2-input positive-nand gates
X; 7401 = quadruple 2-input positive-nand gates with open-collector outputs
X; 7402 = quadruple 2-input positive-nor gates
X; 7403 = quadruple 2-input positive-nand gates with open-collector outputs
X; 7404 = hex inverters
X; 7405 = hex inverters with open-collector outputs
X; 7406 = hex inverter buffers/drivers with open-collector high-voltage outputs
X; 7407 = hex buffers/drivers with open-collector high-voltage outputs
X; 7408 = quadruple 2-input positive-and gates
X; 7409 = quadruple 2-input positive-and gates with open-collector outputs
X; 7410 = triple 3-input positive-nand gates
X; 7411 = triple 3-input positive-and gates
X; 7412 = triple 3-input positive-nand gates with open-collector outputs
X; 7413 = dual 4-input positive-nand schmitt triggers
X; 7414 = hex schmitt-trigger inverters
X; 7415 = triple 3-input positive-and gates with open-collector outputs
X; 7419 = schmitt-trigger inverters with totem-pole outputs
X; 7420 = dual 4-input positive-nand gates
X; 7421 = dual 4-input positive-and gates
X; 7422 = dual 4-input positive-nand gates with open-collector outputs
X; 7423 = dual 4-input nor gates with strobe
X; 7424 = schmitt-trigger positive-nand gates with totem-pole outputs
X; 7425 = dual 4-input nor gates with strobe
X; 7426 = quadruple 2-input high-voltage interface positive-nand gates
X; 7427 = triple 3-input positive-nor gates
X; 7428 = quadruple 2-input positive-nor buffers
X; 7430 = 8-input positive-nand gates
X; 7431 = delay elements
X; 7486 = quadruple 2-input exclusive-or gates
X
Xinclude ttl7400.inc
Xinclude ttl7401.inc
Xinclude ttl7402.inc
Xinclude ttl7403.inc
Xinclude ttl7404.inc
Xinclude ttl7405.inc
Xinclude ttl7406.inc
Xinclude ttl7407.inc
Xinclude ttl7408.inc
Xinclude ttl7409.inc
Xinclude ttl7410.inc
Xinclude ttl7411.inc
Xinclude ttl7412.inc
Xinclude ttl7413.inc
Xinclude ttl7414.inc
Xinclude ttl7415.inc
Xinclude ttl7419.inc
Xinclude ttl7420.inc
Xinclude ttl7421.inc
Xinclude ttl7422.inc
Xinclude ttl7423.inc
Xinclude ttl7424.inc
Xinclude ttl7425.inc
Xinclude ttl7426.inc
Xinclude ttl7427.inc
Xinclude ttl7428.inc
Xinclude ttl7430.inc
Xinclude ttl7431.inc
Xinclude ttl7486.inc
END_OF_FILE
if test 2152 -ne `wc -c <'inc/ttl.inc'`; then
echo shar: \"'inc/ttl.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl.inc'
fi
if test -f 'inc/ttl7400.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7400.inc'\"
else
echo shar: Extracting \"'inc/ttl7400.inc'\" \(181 characters\)
sed "s/^X//" >'inc/ttl7400.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-nand gates
Xchip type=ttl7400 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 181 -ne `wc -c <'inc/ttl7400.inc'`; then
echo shar: \"'inc/ttl7400.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7400.inc'
fi
if test -f 'inc/ttl7401.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7401.inc'\"
else
echo shar: Extracting \"'inc/ttl7401.inc'\" \(209 characters\)
sed "s/^X//" >'inc/ttl7401.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-nand gates with open-collector outputs
Xchip type=ttl7401 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X y1=1
X a1=2
X b1=3
X y2=4
X a2=5
X b2=6
X a3=8
X b3=9
X y3=10
X a4=11
X b4=12
X y4=13
END_OF_FILE
if test 209 -ne `wc -c <'inc/ttl7401.inc'`; then
echo shar: \"'inc/ttl7401.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7401.inc'
fi
if test -f 'inc/ttl7402.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7402.inc'\"
else
echo shar: Extracting \"'inc/ttl7402.inc'\" \(189 characters\)
sed "s/^X//" >'inc/ttl7402.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-nor gates
Xchip type=ttl7402 pins=14 horizontal=2 vertical=6
X 1=y1
X 2=a1
X 3=b1
X 4=y2
X 5=a2
X 6=b2
X 7=gnd
X 8=a3
X 9=b3
X 10=y3
X 11=a4
X 12=b4
X 13=y4
X 14=vcc
END_OF_FILE
if test 189 -ne `wc -c <'inc/ttl7402.inc'`; then
echo shar: \"'inc/ttl7402.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7402.inc'
fi
if test -f 'inc/ttl7403.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7403.inc'\"
else
echo shar: Extracting \"'inc/ttl7403.inc'\" \(209 characters\)
sed "s/^X//" >'inc/ttl7403.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-nand gates with open-collector outputs
Xchip type=ttl7403 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 209 -ne `wc -c <'inc/ttl7403.inc'`; then
echo shar: \"'inc/ttl7403.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7403.inc'
fi
if test -f 'inc/ttl7404.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7404.inc'\"
else
echo shar: Extracting \"'inc/ttl7404.inc'\" \(157 characters\)
sed "s/^X//" >'inc/ttl7404.inc' <<'END_OF_FILE'
X; hex inverters
Xchip type=ttl7404 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 157 -ne `wc -c <'inc/ttl7404.inc'`; then
echo shar: \"'inc/ttl7404.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7404.inc'
fi
if test -f 'inc/ttl7405.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7405.inc'\"
else
echo shar: Extracting \"'inc/ttl7405.inc'\" \(185 characters\)
sed "s/^X//" >'inc/ttl7405.inc' <<'END_OF_FILE'
X; hex inverters with open-collector outputs
Xchip type=ttl7405 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 185 -ne `wc -c <'inc/ttl7405.inc'`; then
echo shar: \"'inc/ttl7405.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7405.inc'
fi
if test -f 'inc/ttl7406.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7406.inc'\"
else
echo shar: Extracting \"'inc/ttl7406.inc'\" \(213 characters\)
sed "s/^X//" >'inc/ttl7406.inc' <<'END_OF_FILE'
X; hex inverter buffers/drivers with open-collector high-voltage outputs
Xchip type=ttl7406 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 213 -ne `wc -c <'inc/ttl7406.inc'`; then
echo shar: \"'inc/ttl7406.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7406.inc'
fi
if test -f 'inc/ttl7407.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7407.inc'\"
else
echo shar: Extracting \"'inc/ttl7407.inc'\" \(204 characters\)
sed "s/^X//" >'inc/ttl7407.inc' <<'END_OF_FILE'
X; hex buffers/drivers with open-collector high-voltage outputs
Xchip type=ttl7407 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 204 -ne `wc -c <'inc/ttl7407.inc'`; then
echo shar: \"'inc/ttl7407.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7407.inc'
fi
if test -f 'inc/ttl7408.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7408.inc'\"
else
echo shar: Extracting \"'inc/ttl7408.inc'\" \(180 characters\)
sed "s/^X//" >'inc/ttl7408.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-and gates
Xchip type=ttl7408 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 180 -ne `wc -c <'inc/ttl7408.inc'`; then
echo shar: \"'inc/ttl7408.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7408.inc'
fi
if test -f 'inc/ttl7409.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7409.inc'\"
else
echo shar: Extracting \"'inc/ttl7409.inc'\" \(208 characters\)
sed "s/^X//" >'inc/ttl7409.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-and gates with open-collector outputs
Xchip type=ttl7409 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 208 -ne `wc -c <'inc/ttl7409.inc'`; then
echo shar: \"'inc/ttl7409.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7409.inc'
fi
if test -f 'inc/ttl7410.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7410.inc'\"
else
echo shar: Extracting \"'inc/ttl7410.inc'\" \(178 characters\)
sed "s/^X//" >'inc/ttl7410.inc' <<'END_OF_FILE'
X; triple 3-input positive-nand gates
Xchip type=ttl7410 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X a2=3
X b2=4
X c2=5
X y2=6
X y3=8
X a3=9
X b3=10
X c3=11
X y1=12
X c1=13
END_OF_FILE
if test 178 -ne `wc -c <'inc/ttl7410.inc'`; then
echo shar: \"'inc/ttl7410.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7410.inc'
fi
if test -f 'inc/ttl7411.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7411.inc'\"
else
echo shar: Extracting \"'inc/ttl7411.inc'\" \(177 characters\)
sed "s/^X//" >'inc/ttl7411.inc' <<'END_OF_FILE'
X; triple 3-input positive-and gates
Xchip type=ttl7411 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X a2=3
X b2=4
X c2=5
X y2=6
X y3=8
X a3=9
X b3=10
X c3=11
X y1=12
X c1=13
END_OF_FILE
if test 177 -ne `wc -c <'inc/ttl7411.inc'`; then
echo shar: \"'inc/ttl7411.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7411.inc'
fi
if test -f 'inc/ttl7412.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7412.inc'\"
else
echo shar: Extracting \"'inc/ttl7412.inc'\" \(206 characters\)
sed "s/^X//" >'inc/ttl7412.inc' <<'END_OF_FILE'
X; triple 3-input positive-nand gates with open-collector outputs
Xchip type=ttl7412 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X a2=3
X b2=4
X c2=5
X y2=6
X y3=8
X a3=9
X b3=10
X c3=11
X y1=12
X c1=13
END_OF_FILE
if test 206 -ne `wc -c <'inc/ttl7412.inc'`; then
echo shar: \"'inc/ttl7412.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7412.inc'
fi
if test -f 'inc/ttl7413.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7413.inc'\"
else
echo shar: Extracting \"'inc/ttl7413.inc'\" \(189 characters\)
sed "s/^X//" >'inc/ttl7413.inc' <<'END_OF_FILE'
X; dual 4-input positive-nand schmitt triggers
Xchip type=ttl7413 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X nc1=3
X c1=4
X d1=5
X y1=6
X y2=8
X a2=9
X b2=10
X nc2=11
X c2=12
X d2=13
END_OF_FILE
if test 189 -ne `wc -c <'inc/ttl7413.inc'`; then
echo shar: \"'inc/ttl7413.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7413.inc'
fi
if test -f 'inc/ttl7414.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7414.inc'\"
else
echo shar: Extracting \"'inc/ttl7414.inc'\" \(173 characters\)
sed "s/^X//" >'inc/ttl7414.inc' <<'END_OF_FILE'
X; hex schmitt-trigger inverters
Xchip type=ttl7414 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 173 -ne `wc -c <'inc/ttl7414.inc'`; then
echo shar: \"'inc/ttl7414.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7414.inc'
fi
if test -f 'inc/ttl7415.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7415.inc'\"
else
echo shar: Extracting \"'inc/ttl7415.inc'\" \(205 characters\)
sed "s/^X//" >'inc/ttl7415.inc' <<'END_OF_FILE'
X; triple 3-input positive-and gates with open-collector outputs
Xchip type=ttl7415 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X a2=3
X b2=4
X c2=5
X y2=6
X y3=8
X a3=9
X b3=10
X c3=11
X y1=12
X c1=13
END_OF_FILE
if test 205 -ne `wc -c <'inc/ttl7415.inc'`; then
echo shar: \"'inc/ttl7415.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7415.inc'
fi
if test -f 'inc/ttl7419.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7419.inc'\"
else
echo shar: Extracting \"'inc/ttl7419.inc'\" \(193 characters\)
sed "s/^X//" >'inc/ttl7419.inc' <<'END_OF_FILE'
X; schmitt-trigger inverters with totem-pole outputs
Xchip type=ttl7419 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X y3=6
X y4=8
X a4=9
X y5=10
X a5=11
X y6=12
X a6=13
END_OF_FILE
if test 193 -ne `wc -c <'inc/ttl7419.inc'`; then
echo shar: \"'inc/ttl7419.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7419.inc'
fi
if test -f 'inc/ttl7420.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7420.inc'\"
else
echo shar: Extracting \"'inc/ttl7420.inc'\" \(178 characters\)
sed "s/^X//" >'inc/ttl7420.inc' <<'END_OF_FILE'
X; dual 4-input positive-nand gates
Xchip type=ttl7420 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X nc1=3
X c1=4
X d1=5
X y1=6
X y2=8
X a2=9
X b2=10
X nc2=11
X c2=12
X d2=13
END_OF_FILE
if test 178 -ne `wc -c <'inc/ttl7420.inc'`; then
echo shar: \"'inc/ttl7420.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7420.inc'
fi
if test -f 'inc/ttl7421.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7421.inc'\"
else
echo shar: Extracting \"'inc/ttl7421.inc'\" \(177 characters\)
sed "s/^X//" >'inc/ttl7421.inc' <<'END_OF_FILE'
X; dual 4-input positive-and gates
Xchip type=ttl7421 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X nc1=3
X c1=4
X d1=5
X y1=6
X y2=8
X a2=9
X b2=10
X nc2=11
X c2=12
X d2=13
END_OF_FILE
if test 177 -ne `wc -c <'inc/ttl7421.inc'`; then
echo shar: \"'inc/ttl7421.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7421.inc'
fi
if test -f 'inc/ttl7422.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7422.inc'\"
else
echo shar: Extracting \"'inc/ttl7422.inc'\" \(206 characters\)
sed "s/^X//" >'inc/ttl7422.inc' <<'END_OF_FILE'
X; dual 4-input positive-nand gates with open-collector outputs
Xchip type=ttl7422 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X nc1=3
X c1=4
X d1=5
X y1=6
X y2=8
X a2=9
X b2=10
X nc2=11
X c2=12
X d2=13
END_OF_FILE
if test 206 -ne `wc -c <'inc/ttl7422.inc'`; then
echo shar: \"'inc/ttl7422.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7422.inc'
fi
if test -f 'inc/ttl7423.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7423.inc'\"
else
echo shar: Extracting \"'inc/ttl7423.inc'\" \(194 characters\)
sed "s/^X//" >'inc/ttl7423.inc' <<'END_OF_FILE'
X; dual 4-input nor gates with strobe
Xchip type=ttl7423 pins=16 horizontal=2 vertical=6
X vcc=16
X gnd=8
X x1=1
X a1=2
X b1=3
X g1=4
X c1=5
X d1=6
X y1=7
X y2=9
X a2=10
X b2=11
X g2=12
X c2=13
X d2=14
X xbar=15
END_OF_FILE
if test 194 -ne `wc -c <'inc/ttl7423.inc'`; then
echo shar: \"'inc/ttl7423.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7423.inc'
fi
if test -f 'inc/ttl7424.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7424.inc'\"
else
echo shar: Extracting \"'inc/ttl7424.inc'\" \(203 characters\)
sed "s/^X//" >'inc/ttl7424.inc' <<'END_OF_FILE'
X; schmitt-trigger positive-nand gates with totem-pole outputs
Xchip type=ttl7424 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 203 -ne `wc -c <'inc/ttl7424.inc'`; then
echo shar: \"'inc/ttl7424.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7424.inc'
fi
if test -f 'inc/ttl7425.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7425.inc'\"
else
echo shar: Extracting \"'inc/ttl7425.inc'\" \(178 characters\)
sed "s/^X//" >'inc/ttl7425.inc' <<'END_OF_FILE'
X; dual 4-input nor gates with strobe
Xchip type=ttl7425 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X g1=3
X c1=4
X d1=5
X y1=6
X y2=8
X a2=9
X b2=10
X g2=11
X c2=12
X d2=13
END_OF_FILE
if test 178 -ne `wc -c <'inc/ttl7425.inc'`; then
echo shar: \"'inc/ttl7425.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7425.inc'
fi
if test -f 'inc/ttl7426.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7426.inc'\"
else
echo shar: Extracting \"'inc/ttl7426.inc'\" \(204 characters\)
sed "s/^X//" >'inc/ttl7426.inc' <<'END_OF_FILE'
X; quadruple 2-input high-voltage interface positive-nand gates
Xchip type=ttl7426 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 204 -ne `wc -c <'inc/ttl7426.inc'`; then
echo shar: \"'inc/ttl7426.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7426.inc'
fi
if test -f 'inc/ttl7427.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7427.inc'\"
else
echo shar: Extracting \"'inc/ttl7427.inc'\" \(177 characters\)
sed "s/^X//" >'inc/ttl7427.inc' <<'END_OF_FILE'
X; triple 3-input positive-nor gates
Xchip type=ttl7427 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X a2=3
X b2=4
X c2=5
X y2=6
X y3=8
X a3=9
X b3=10
X c3=11
X y1=12
X c1=13
END_OF_FILE
if test 177 -ne `wc -c <'inc/ttl7427.inc'`; then
echo shar: \"'inc/ttl7427.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7427.inc'
fi
if test -f 'inc/ttl7428.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7428.inc'\"
else
echo shar: Extracting \"'inc/ttl7428.inc'\" \(182 characters\)
sed "s/^X//" >'inc/ttl7428.inc' <<'END_OF_FILE'
X; quadruple 2-input positive-nor buffers
Xchip type=ttl7428 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X y1=1
X a1=2
X b1=3
X y2=4
X a2=5
X b2=6
X a3=8
X b3=9
X y3=10
X a4=11
X b4=12
X y4=13
END_OF_FILE
if test 182 -ne `wc -c <'inc/ttl7428.inc'`; then
echo shar: \"'inc/ttl7428.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7428.inc'
fi
if test -f 'inc/ttl7430.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7430.inc'\"
else
echo shar: Extracting \"'inc/ttl7430.inc'\" \(165 characters\)
sed "s/^X//" >'inc/ttl7430.inc' <<'END_OF_FILE'
X; 8-input positive-nand gates
Xchip type=ttl7430 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a=1
X b=2
X c=3
X d=4
X e=5
X f=6
X y=8
X nc1=9
X nc2=10
X g=11
X h=12
X nc3=13
END_OF_FILE
if test 165 -ne `wc -c <'inc/ttl7430.inc'`; then
echo shar: \"'inc/ttl7430.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7430.inc'
fi
if test -f 'inc/ttl7431.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7431.inc'\"
else
echo shar: Extracting \"'inc/ttl7431.inc'\" \(172 characters\)
sed "s/^X//" >'inc/ttl7431.inc' <<'END_OF_FILE'
X; delay elements
Xchip type=ttl7431 pins=16 horizontal=2 vertical=6
X vcc=16
X gnd=8
X a1=1
X y1=2
X a2=3
X y2=4
X a3=5
X b3=6
X y3=7
X y4=9
X a4=10
X b4=11
X y5=12
X a5=13
X y6=14
X a6=15
END_OF_FILE
if test 172 -ne `wc -c <'inc/ttl7431.inc'`; then
echo shar: \"'inc/ttl7431.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7431.inc'
fi
if test -f 'inc/ttl7486.inc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'inc/ttl7486.inc'\"
else
echo shar: Extracting \"'inc/ttl7486.inc'\" \(180 characters\)
sed "s/^X//" >'inc/ttl7486.inc' <<'END_OF_FILE'
X; quadruple 2-input exclusive-or gates
Xchip type=ttl7486 pins=14 horizontal=2 vertical=6
X vcc=14
X gnd=7
X a1=1
X b1=2
X y1=3
X a2=4
X b2=5
X y2=6
X y3=8
X a3=9
X b3=10
X y4=11
X a4=12
X b4=13
END_OF_FILE
if test 180 -ne `wc -c <'inc/ttl7486.inc'`; then
echo shar: \"'inc/ttl7486.inc'\" unpacked with wrong size!
fi
# end of 'inc/ttl7486.inc'
fi
if test ! -d 'old' ; then
echo shar: Creating directory \"'old'\"
mkdir 'old'
fi
if test -f 'old/bitmap.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'old/bitmap.c'\"
else
echo shar: Extracting \"'old/bitmap.c'\" \(1599 characters\)
sed "s/^X//" >'old/bitmap.c' <<'END_OF_FILE'
X#include "cell.h"
X
X#define ZOOM0 3 /* 3x3 pixels per cell */
X#define ZOOM1 6 /* 6x6 pixels per cell */
X#define ZOOM2 10 /* 10x10 pixels per cell */
X#define ZOOM3 18 /* 18x18 pixels per cell */
X
X/*
X** the templates assume the pixels on your screen have a 1:1 aspect ratio. for
X** almost all screens, this is not true. therefore, the screen view will be
X** slightly distorted (things will look like they are stretched top to bottom,
X** or squashed side to side). if you really want things to look like reality,
X** you could change the dimensions of the templates. for example, if your
X** screen has a 2:1 aspect ratio (most are more like 1.4:1), use a [3][6]
X** template instead of a [3][3] one. as long as you keep this in mind while
X** viewing the results, it's probably not worth the effort.
X*/
X
Xstruct x { /* group the bit templates for an object */
X long t; /* the object type */
X char t0[ZOOM0][ZOOM0]; /* tiny zoom template */
X char t1[ZOOM1][ZOOM1]; /* small zoom template */
X char t2[ZOOM2][ZOOM2]; /* medium zoom template */
X char t3[ZOOM3][ZOOM3]; /* large zoom template */
X };
X
X/* these got too big to keep in one file, so i moved them to include files */
X
Xstruct x y1[] = { /* hole templates */
X#include "bitmap1.h"
X };
X
Xstruct x y2[] = { /* hole-related templates */
X#include "bitmap2.h"
X };
X
Xstruct x y3[] = { /* non-hole-related templates */
X#include "bitmap3.h"
X };
X
Xint z1 = sizeof(y1)/sizeof(y1[0]); /* number of hole types */
Xint z2 = sizeof(y2)/sizeof(y2[0]); /* number of hole-related types */
Xint z3 = sizeof(y3)/sizeof(y3[0]); /* number of non-hole-related types */
END_OF_FILE
if test 1599 -ne `wc -c <'old/bitmap.c'`; then
echo shar: \"'old/bitmap.c'\" unpacked with wrong size!
fi
# end of 'old/bitmap.c'
fi
if test -f 'old/bitmap1.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'old/bitmap1.h'\"
else
echo shar: Extracting \"'old/bitmap1.h'\" \(1397 characters\)
sed "s/^X//" >'old/bitmap1.h' <<'END_OF_FILE'
X/* hole templates */
X/* NOTE: these templates are UPSIDE-DOWN from what you see on the screen!!! */
X
X { HOLE,
X
X { { 0,0,0 },
X { 0,1,0 },
X { 0,0,0 } },
X
X { { 0,0,0,0,0,0 },
X { 0,0,1,1,0,0 },
X { 0,1,0,0,1,0 },
X { 0,1,0,0,1,0 },
X { 0,0,1,1,0,0 },
X { 0,0,0,0,0,0 } },
X
X { { 0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,1,1,0,0,0,0 },
X { 0,0,0,1,0,0,1,0,0,0 },
X { 0,0,1,0,0,0,0,1,0,0 },
X { 0,0,1,0,0,0,0,1,0,0 },
X { 0,0,0,1,0,0,1,0,0,0 },
X { 0,0,0,0,1,1,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0 } },
X
X { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0 },
X { 0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0 },
X { 0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0 },
X { 0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
X { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
X }
END_OF_FILE
if test 1397 -ne `wc -c <'old/bitmap1.h'`; then
echo shar: \"'old/bitmap1.h'\" unpacked with wrong size!
fi
# end of 'old/bitmap1.h'
fi
if test -f 'queue.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'queue.c'\"
else
echo shar: Extracting \"'queue.c'\" \(3363 characters\)
sed "s/^X//" >'queue.c' <<'END_OF_FILE'
X#include <stdio.h>
X
X/*
X#ifndef M_XENIX
X#include <stdlib.h>
X#endif
X*/
X
X/*
X#include <malloc.h>
X*/
X#include "cell.h"
X
Xextern char *Alloc();
X
Xstruct queue { /* search queue structure */
X int Row; /* current row */
X int Col; /* current column */
X int Side; /* 0=top, 1=bottom */
X int Dist; /* path distance to this cell so far */
X int ApxDist; /* approximate distance to target from here */
X struct queue *Next;
X };
X
X/* search statistics */
Xlong OpenNodes = 0; /* total number of nodes opened */
Xlong ClosNodes = 0; /* total number of nodes closed */
Xlong MoveNodes = 0; /* total number of nodes moved */
Xlong MaxNodes = 0; /* maximum number of nodes opened at one time */
X
Xstatic long qlen = 0; /* current queue length */
X
Xstatic struct queue *Head = NULL;
Xstatic struct queue *Tail = NULL;
Xstatic struct queue *Save = NULL; /* hold empty queue structs */
X
Xextern void Nomem();
X
Xvoid InitQueue();
Xvoid GetQueue();
Xvoid SetQueue();
Xvoid ReSetQueue();
X
Xvoid InitQueue () { /* initialize the search queue */
X struct queue *p;
X
X while (p = Head) {
X Head = p->Next;
X p->Next = Save;
X Save = p;
X }
X Tail = NULL;
X OpenNodes = ClosNodes = MoveNodes = MaxNodes = qlen = 0;
X }
X
Xvoid GetQueue ( r, c, s, d, a ) /* get search queue item from list */
X int *r, *c, *s, *d, *a;
X {
X struct queue *p;
X
X if (p = Head) { /* return first item in list */
X *r = p->Row;
X *c = p->Col;
X *s = p->Side;
X *d = p->Dist;
X *a = p->ApxDist;
X if (!(Head = p->Next))
X Tail = NULL;
X /* put node on free list */
X p->Next = Save;
X Save = p;
X ClosNodes++;
X qlen--;
X }
X else /* empty list */
X *r = *c = *s = *d = *a = ILLEGAL;
X }
X
Xvoid SetQueue ( r, c, s, d, a, r2, c2 ) /* add a search node to the list */
X int r, c, s, d, a, r2, c2;
X {
X struct queue *p;
X struct queue *q;
X struct queue *t;
X register int i;
X int j;
X
X if (p = Save) /* try free list first */
X Save = p->Next;
X else if (!(p = (struct queue *)Alloc( (long)sizeof(struct queue) )))
X Nomem();
X p->Row = r;
X p->Col = c;
X p->Side = s;
X i = (p->Dist = d) + (p->ApxDist = a);
X p->Next = NULL;
X if (q = Head) { /* insert in proper position in list */
X if (q->Dist + q->ApxDist > i) { /* insert at head */
X p->Next = q;
X Head = p;
X }
X else { /* search for proper position */
X for (t = q, q = q->Next;
X q && i > (j = q->Dist + q->ApxDist);
X t = q, q = q->Next)
X ;
X if (q && i == j && q->Row == r2 && q->Col == c2) {
X /* insert after q, which is a goal node */
X if (!(p->Next = q->Next))
X Tail = p;
X q->Next = p;
X }
X else { /* insert in front of q */
X if (!(p->Next = q))
X Tail = p;
X t->Next = p;
X }
X }
X }
X else /* empty search list */
X Head = Tail = p;
X OpenNodes++;
X if (++qlen > MaxNodes)
X MaxNodes = qlen;
X }
X
Xvoid ReSetQueue ( r, c, s, d, a, r2, c2 ) /* reposition node in list */
X register int r, c;
X int s, d, a, r2, c2;
X {
X struct queue *p;
X struct queue *q;
X
X /* first, see if it is already in the list */
X for (q = NULL, p = Head; p; q = p, p = p->Next) {
X if (p->Row == r && p->Col == c && p->Side == s) {
X /* old one to remove */
X if (q) {
X if (!(q->Next = p->Next))
X Tail = q;
X }
X else if (!(Head = p->Next))
X Tail = NULL;
X p->Next = Save;
X Save = p;
X OpenNodes--;
X MoveNodes++;
X qlen--;
X break;
X }
X }
X /* if it was there, it's gone now; insert it at the proper position */
X SetQueue( r, c, s, d, a, r2, c2 );
X }
END_OF_FILE
if test 3363 -ne `wc -c <'queue.c'`; then
echo shar: \"'queue.c'\" unpacked with wrong size!
fi
# end of 'queue.c'
fi
if test -f 'sources.hdr' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'sources.hdr'\"
else
echo shar: Extracting \"'sources.hdr'\" \(1862 characters\)
sed "s/^X//" >'sources.hdr' <<'END_OF_FILE'
XChecksum: 1535076610 (Verify with "brik -cv")
XPosting-number: Volume 02, Issue 061
XSubmitted-by: microsoft!randyn@beaver.cs.washington.edu (Randy Nevin)
XArchive-name: pcbcad/part01
X
Xthis is a printed circuit board cad package for the ibm pc; please post it
Xon comp.binaries.ibm.pc. it consists of an autorouter, a printed circuit
Xboard viewer, and a printed circuit board printer. it currently supports
Xega and hp laser jet II. source is included, along with an article i have
Xsubmitted to dr. dobb's journal (and may be printed later this year), and
Xa small ttl library. i have also sent it to keith peterson, so it will be
Xavailable in the simtel20 archives for ftp access. note that the
Xexecutables included have been compiled to use 286 instructions; if you
Xwant to run these programs on an XT (not recommended), change the /G2s
Xto /Gs in the makefile and recompile.
X
X randy nevin (microsoft!randyn@beaver.cs.washington.edu, or
X microsoft!randyn@uunet.uu.net)
X
X[
XTo try out the provided example in the file "example", first type
X"pcbroute example outfile" to get the generated circuit into "outfile",
Xthen type "pcbview outfile" to view it. It worked fine on a
XVGA-equipped IBM PS/2 with about 450K of free memory.
X
XAll the source code (all C but for one small assembly language file) is
Xhere, suitable for Microsoft C 4.0 and MASM 4.0.
X
XThere is a good discussion of the algorithms needed to optimize the
Xlayout of traces on a PCB.
X
XChecksums obtained with the 4.3BSD "sum" or System V "sum -r" command.
X
Xchecksum size (bytes) file (between BEGIN--cut and END--cut lines)
X 15220 43731 part01
X 41974 43772 part02
X 22640 43772 part03
X 5344 43122 part04
X
Xchecksum size (bytes) file
X 13593 126558 pcbcad.arc
X
X-- R.D.
X]
X
Xpcbcad part01/04
XBEGIN--cut here--cut here
END_OF_FILE
if test 1862 -ne `wc -c <'sources.hdr'`; then
echo shar: \"'sources.hdr'\" unpacked with wrong size!
fi
# end of 'sources.hdr'
fi
if test -f 'util.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'util.c'\"
else
echo shar: Extracting \"'util.c'\" \(266 characters\)
sed "s/^X//" >'util.c' <<'END_OF_FILE'
Xextern struct RastPort *rastp;
X
X/*
X * write a dot on the screen
X */
Xvoid Dot( color, pixrow, pixcol )
Xint color, pixrow, pixcol;
X{
X SetAPen(rastp,(long)color);
X WritePixel(rastp,(long)pixcol,(long)pixrow);
X}
X
XClearPCB()
X{
X Move(rastp,0L,15L);
X ClearScreen(rastp);
X}
END_OF_FILE
if test 266 -ne `wc -c <'util.c'`; then
echo shar: \"'util.c'\" unpacked with wrong size!
fi
# end of 'util.c'
fi
if test -f 'work.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'work.c'\"
else
echo shar: Extracting \"'work.c'\" \(2810 characters\)
sed "s/^X//" >'work.c' <<'END_OF_FILE'
X#include <stdio.h>
X
X/*
X#ifndef M_XENIX
X#include <stdlib.h>
X#endif
X
X#include <malloc.h>
X*/
X#include "cell.h"
X
Xextern char *Alloc();
X
Xstruct work { /* a unit of work is a hole-pair to connect */
X int FromRow; /* source row */
X int FromCol; /* source column */
X char *FromName; /* source name */
X int ToRow; /* target row */
X int ToCol; /* target column */
X char *ToName; /* target name */
X int ApxDist; /* approximate distance */
X int Priority; /* 0=no, 1=yes */
X struct work *Next;
X };
X
X/* pointers to the first and last item of work to do */
Xstatic struct work *Head = NULL;
Xstatic struct work *Tail = NULL;
X
Xextern int Ntotal;
X
Xextern int GetApxDist();
Xextern void Nomem();
X
Xvoid InitWork();
Xvoid SetWork();
Xvoid GetWork();
Xvoid SortWork();
X
Xvoid InitWork () { /* initialize the work list */
X struct work *p;
X
X while (p = Head) {
X Head = p->Next;
X Free( p );
X }
X Tail = NULL;
X }
X
Xvoid SetWork ( r1, c1, n1, r2, c2, n2, pri )
X /* add a unit of work to the work list */
X int r1, c1, r2, c2, pri;
X char *n1;
X char *n2;
X {
X struct work *p;
X
X if (p = (struct work *)Alloc( (long)sizeof(struct work) )) {
X p->FromRow = r1;
X p->FromCol = c1;
X p->FromName = n1;
X p->ToRow = r2;
X p->ToCol = c2;
X p->ToName = n2;
X p->ApxDist = GetApxDist( r1, c1, r2, c2 );
X p->Priority = pri;
X p->Next = NULL;
X if (Head) /* attach at end */
X Tail->Next = p;
X else /* first in list */
X Head = p;
X Tail = p;
X Ntotal++;
X }
X else /* can't get any more memory */
X Nomem();
X }
X
Xvoid GetWork ( r1, c1, n1, r2, c2, n2 )
X /* fetch a unit of work from the work list */
X int *r1, *c1, *r2, *c2;
X char **n1;
X char **n2;
X {
X struct work *p;
X
X if (p = Head) {
X *r1 = p->FromRow;
X *c1 = p->FromCol;
X *n1 = p->FromName;
X *r2 = p->ToRow;
X *c2 = p->ToCol;
X *n2 = p->ToName;
X if (!(Head = p->Next))
X Tail = NULL;
X Free( p );
X }
X else { /* none left */
X *r1 = *c1 = *r2 = *c2 = ILLEGAL;
X *n1 = *n2 = NULL;
X }
X }
X
Xvoid SortWork () { /* order the work items; shortest first */
X struct work *p;
X struct work *q0; /* put PRIORITY CONNECTs in q0 */
X struct work *q1; /* sort other CONNECTs in q1 */
X struct work *r;
X
X q0 = q1 = NULL;
X while (p = Head) { /* prioritize each work item */
X Head = Head->Next;
X if (p->Priority) {
X if (!(r = q0)) {
X p->Next = q0;
X q0 = p;
X }
X else {
X while (r->Next)
X r = r->Next;
X p->Next = r->Next;
X r->Next = p;
X }
X }
X else if (!(r = q1) || p->ApxDist < q1->ApxDist) {
X p->Next = q1;
X q1 = p;
X }
X else { /* find proper position in list */
X while (r->Next && p->ApxDist >= r->ApxDist)
X r = r->Next;
X p->Next = r->Next;
X r->Next = p;
X }
X }
X if (p = q0) {
X while (q0->Next)
X q0 = q0->Next;
X q0->Next = q1;
X }
X else
X p = q1;
X /* reposition Head and Tail */
X for (Tail = Head = p; Tail && Tail->Next; Tail = Tail->Next)
X ;
X }
END_OF_FILE
if test 2810 -ne `wc -c <'work.c'`; then
echo shar: \"'work.c'\" unpacked with wrong size!
fi
# end of 'work.c'
fi
echo shar: End of archive 1 \(of 6\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 6 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
Mail comments to the moderator at <amiga-request@cs.odu.edu>.
Post requests for sources, and general discussion to comp.sys.amiga.